// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

@import '../../common/styles/colors.scss';
@import '../../common/styles/fonts.scss';

@mixin fill-available-width {
    // `stretch` is experimental: https://caniuse.com/mdn-css_properties_width_stretch
    width: -moz-available;
    width: -webkit-fill-available;
    width: stretch;
}

.hidden-highlight-button {
    opacity: 0;
    margin: 0;
    padding: 0;
    border: none;
}

.instance-details-card {
    border-radius: 4px;
    border: 1px solid $card-border;
    outline-style: 'border-style';
    box-shadow:
        0 0.6px 1.8px $box-shadow-108,
        0 3.2px 7.2px $box-shadow-132;
    margin-bottom: 16px;
    @include fill-available-width;
}

.instance-details-card-container.selected {
    outline: 5px solid $communication-tint-10;
}

.instance-details-card.selected {
    border: 1px solid transparent;
}

.instance-details-card.focused,
.instance-details-card:focus {
    outline: 2px solid $primary-text;
    outline-offset: 2px;
}

.instance-details-card.selected.focused,
.instance-details-card.selected:focus {
    outline-offset: 8px;
}

.instance-details-card.interactive {
    cursor: pointer;
}

.instance-details-card.interactive:hover {
    box-shadow:
        0 8px 10px $box-shadow-108,
        0 8px 10px $box-shadow-132;
}

.report-instance-table {
    background: $neutral-0;
    display: table;
    table-layout: fixed;
    @include fill-available-width;

    border-radius: inherit;
    border-collapse: collapse;
    overflow-wrap: break-word;
    word-break: break-word;

    .row {
        display: flex;
        flex-wrap: wrap;

        // The padding on the parent and margins on the children are coupled; they
        // are intended to produce the desired spacing regardless of whether the children
        // are presented side-by-side or wrapped
        padding-top: 2px;
        padding-bottom: 14px;
        padding-left: 0;
        padding-right: 20px;

        > * {
            margin-top: 12px;
            margin-bottom: 0;
            margin-left: 20px;
            margin-right: 0;
            padding: 0;
        }

        border-bottom: 0.5px solid $neutral-10;

        &:last-child {
            border-bottom: none;
        }
    }

    .row-label {
        // This functions as the width of the label; it is sized to match the widest
        // text we know the label to render in actual usage (currently "How to check"),
        // plus 4px of fudge-factor to account for differences in fonts across browsers/OS
        flex-basis: 90px;
        flex-shrink: 1;
        flex-grow: 0;
        font-size: 14px;
        line-height: 20px;
        font-weight: $font-weight-semi-bold;
        color: $primary-text;
        text-align: left;
    }

    .row-content {
        flex-basis: 200px;
        flex-shrink: 1;
        flex-grow: 1;
        color: $secondary-text;
        font-size: 14px;
        line-height: 20px;
        align-items: flex-end;
        display: flex;
    }
}
